<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::group(['namespace' => 'Admin' , 'prefix' => 'admin' ] , function(){
    Route::group(['middleware' => 'AdminAuth'] , function (){

        Route::get('/logout', 'AdminUserController@logout');

        //活动管理
        Route::group(['prefix' => 'activity'] , function (){
            Route::get('/', 'ActivityController@index');//活动列表页面
            Route::get('/add', 'ActivityController@add');//活动添加
            Route::post('/add', 'ActivityController@doAdd');
            Route::get('/gather', 'ActivityController@gather');//添加活动合集
            Route::post('/gather/save', 'ActivityController@gather_add');//添加活动合集
            Route::get('/copy/{id}', 'ActivityController@copy');//活动复制
            Route::post('/copy', 'ActivityController@doCopy');
            Route::get('/edit/{id}', 'ActivityController@edit');//活动修改
            Route::post('/edit','ActivityController@doEdit');
            Route::get('/delete/{id}', 'ActivityController@delete');//活动删除
            Route::post('/update/cost', 'ActivityController@costUpdate');//费用说明编辑
            Route::get('/cost/{id}', 'ActivityController@cost');
            Route::post('/update/route', 'ActivityController@routeUpdate');//路线说明编辑
            Route::get('/route/{id}', 'ActivityController@route');
            Route::get('/imgslist/{id}', 'ActivityController@imgslist');//活动图片列表页面
            Route::get('/imgsadd/{id}', 'ActivityController@imgsadd');//活动图片添加
            Route::post('/imgsadd', 'ActivityController@imgsdoAdd');
            Route::get('/imgsdel/{id}', 'ActivityController@imgsdel');//图片删除
            Route::get('/enroll/{id}', 'ActivityController@enroll');//活动报名页面
            Route::get('/enroll/HistoryEnroll/{id}', 'ActivityController@HistoryEnroll');//活动历史报名
            Route::get('/enrolledit/{id}', 'ActivityController@enrolledit');//活动报名积分修改
            Route::post('/enrolledit','ActivityController@enrolldoEdit');
            Route::get('/enreason/{enrollId}/{personalId}', 'ActivityController@enreason');//活动报名备注修改
            Route::post('/enreason','ActivityController@doEnReason');
            Route::get('enrolldelete/{enrollId}/{personalId}', 'ActivityController@enrolldelete');//活动报名删除
            Route::get('/morindex', 'ActivityController@morindex');//手机版活动列表页面
            Route::get('/morenroll/{id}', 'ActivityController@morenroll');//手机版活动报名页面
            Route::get('/morhistory/{id}', 'ActivityController@morhistory');//手机版历史活动报名页面
            Route::get('/morenrolldelete/{enrollId}/{personalId}', 'ActivityController@morenrolldelete');//手机版活动报名删除
            Route::get('/morenreason/{enrollId}/{personalId}', 'ActivityController@morenreason');//手机版活动报名备注
            Route::POST('/morenreason', 'ActivityController@doMorEnReason');//手机版活动报名备注
        });

        //轮播图管理
        Route::group(['prefix' => 'banner'] , function (){
            Route::get('/', 'BannerController@index');
            Route::get('/add', 'BannerController@add');
            Route::post('/add', 'BannerController@doAdd');
            Route::get('/edit/{id}', 'BannerController@edit');
            Route::post('/edit','BannerController@doEdit');
            Route::get('/delete/{id}', 'BannerController@delete');
        });
        //个人中心
        Route::group(['prefix' => 'personal'] , function (){
            Route::get('/', 'PersonalController@index');//首页
            Route::get('/edit/{id}', 'PersonalController@edit');//修改
            Route::post('/edit','PersonalController@doEdit');
            Route::get('/delete/{id}', 'PersonalController@delete');//删除
        });
        //招聘信息
        Route::group(['prefix' => 'recruit'] , function (){
            Route::get('/', 'RecruitController@index');
            Route::get('/delete/{id}', 'RecruitController@delete');//删除
        });
        //介绍信息
        Route::group(['prefix' => 'introduce'] , function (){
            Route::get('/', 'IntroduceController@index');
            Route::post('/update/edit', 'IntroduceController@editUpdate');//介绍说明编辑
            Route::get('/edit/{id}', 'IntroduceController@edit');
            Route::get('/delete/{id}', 'IntroduceController@delete');//删除
        });
        //分类管理
        Route::group(['prefix' => 'classify'] , function (){
            Route::get('/', 'ClassifyController@index');
            Route::get('/add', 'ClassifyController@add');
            Route::post('/add', 'ClassifyController@doAdd');
            Route::get('/edit/{id}', 'ClassifyController@edit');
            Route::post('/edit','ClassifyController@doEdit');
            Route::get('/delete/{id}', 'ClassifyController@delete');
        });

        //图片分类管理
        Route::group(['prefix' => 'imgcate'] , function (){
            Route::get('/', 'ImgcateController@index');
            Route::get('/add', 'ImgcateController@add');
            Route::post('/add', 'ImgcateController@doAdd');
            Route::get('/delete/{id}', 'ImgcateController@delete');
            Route::get('/imglist/{id}', 'ImgcateController@imglist');//图片列表页面
            Route::get('/imgadd/{id}', 'ImgcateController@imgadd');//图片添加
            Route::post('/imgadd', 'ImgcateController@imgdoAdd');
            Route::get('/imgdel/{id}', 'ImgcateController@imgdel');//图片删除
        });


        Route::get('index' , 'ActivityController@index');

        //权限节点start
        Route::get('/permission' , 'AdminPermissionController@getList');
        Route::get('/permission/info/{id}' , 'AdminPermissionController@getInfo');
        Route::post('/permission/update' , 'AdminPermissionController@update');
        Route::get('/permission/delete/{id}' , 'AdminPermissionController@delete');
        Route::get('/permission/add' , 'AdminPermissionController@add');
        Route::post('/permission/add' , 'AdminPermissionController@doAdd');
        //权限节点end

        //角色start
        Route::get('/roles' , 'AdminRoleController@getRoleList');
        Route::get('/roles/permission/{id}' , 'AdminRoleController@getRolePermission');
        Route::post('/roles/update' , 'AdminRoleController@updateRole');
        Route::get('/role/add' , 'AdminRoleController@addRole');
        Route::post('/role/add' , 'AdminRoleController@doAddRole');

        Route::post('/roles/del' , 'AdminRoleController@delRole');
        //角色end

        //账号start
        Route::get('/adminuser' , 'AdminUserController@getList');
        Route::get('/adminuser/info/{id}' , 'AdminUserController@getInfo');
        Route::get('/adminuser/add' , 'AdminUserController@add');
        Route::post('/adminuser/add' , 'AdminUserController@doAdd');
        Route::post('/adminuser/update' , 'AdminUserController@update');
        Route::post('/adminuser/update/permission' , 'AdminUserController@updatePermission');

        Route::get('/adminuser/permission/{id}' , 'AdminUserController@getPermission');
        //账号end

        Route::get('/current/user' , 'AdminUserController@currentLoginUser');
    });

    Route::post('upload/img/{owner}' , 'UploadController@uploadImg');

    Route::get('error' , 'ErrorController@error');
    Route::get('login' , 'AdminUserController@login');
    Route::post('login' , 'AdminUserController@doLogin');
});
